<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        img{
            width:200px;
        }
        
    </style>
</head>
<body>
    <div id = "parent">
        <p>hello world</p>
    </div>
    <script>
        var parent = document.getElementById("parent");
        var img = document.createElement("img");
        img.src="img/img-7f3a16e0d3745165410adeb572353510.jpg";
        img.id="img";
        img.className="img";
        parent.appendChild(img);
        console.log(img);
    </script>
</body>
</html>